import request from '@/config/axios'

export interface NetPayOrderVO {
  id: number
  ownMemberUserId: number
  ownMemberMatCode: string
  memberUserId: number
  orderId: string
  merchantId: string
  terminalId: string
  instMid: string
  subAppid: string
  subOpenid: string
  tradeType: string
  commId: number
  payNetServerId: number
  netIntefaceUrl: string
  subject: string
  body: string
  amount: number
  accountAddrOflf: string
  platformFeeRate: number
  platformFeeAmount: number
  channelFeeRate: number
  channelFeeAmount: number
  balance: number
  status: number
  downNetFlag: number
  userIp: string
  expireTime: Date
  successTime: Date
  closeTime: Date
  notifyTime: Date
  refundStatus: number
  refundTime: Date
  refundChannelAmount: number
  refundAmount: number
  oldNetServerId: number
  oldNetExpireTime: Date
  oldNetMoney: number
  newNetMoney: number
  newNetServerId: number
  newNetExpirtTime: Date
  linkAccountMapId: number
  linkCommMapId: number
}

// 查询宽带充值订单列表
export const getNetPayOrderPage = async (params) => {
  return await request.get({ url: `/zwsj/net-pay-order/page`, params })
}

// 查询宽带充值订单详情
export const getNetPayOrder = async (id: number) => {
  return await request.get({ url: `/zwsj/net-pay-order/get?id=` + id })
}

// 删除宽带充值订单
export const deleteNetPayOrder = async (id: number) => {
  return await request.delete({ url: `/zwsj/net-pay-order/delete?id=` + id })
}

// 导出宽带充值订单 Excel
export const exportNetPayOrder = async (params) => {
  return await request.download({ url: `/zwsj/net-pay-order/export-excel`, params })
}

// 获取银联支付结果
export const getUnionMiniPayOrderInfo = async (netPayOrderId: number) => {
  return await request.get({
    url: `/zwsj/net-pay-order/union/pay/order/info?netPayOrderId=` + netPayOrderId
  })
}
